import { fileURLToPath } from 'node:url'
import { dirname, resolve } from 'path'
import { JSONFilePreset } from 'lowdb/node'

const __dirname = dirname(fileURLToPath(import.meta.url))

// const db = await JSONFilePreset("./db/db.json", defaultData);

// db.data.posts.push("hello world");
// await db.write();

export const projectConfig = await JSONFilePreset(resolve(__dirname, '../data/project.json'), {
  domain: 'https://attack.mitre.org',

  techniqueIndex: 0,

  subTechniqueIndex: 0,
  subTechniqueContentIndex: 0,

  translateTechniqueIndex: 0,
  translateSubTechniqueIndex: 0,

  mitigationIndex: 0,

  debug: false,
})

export default {
  projectConfig,
}
